<template>
    <div>
        <div v-for="item in dataFormConfig" :key="item.code">
            <el-form-item :label="item.label" :prop="item.code" :key="item.code">
                <!-- input -->
                <el-input
                    v-if="item.type === 'input'"
                    v-model="dataFormMenu[item.code]"
                    :placeholder="item.placeholder"
                />
                <!-- textarea -->
                <el-input
                    v-if="item.type === 'textarea'"
                    type="textarea"
                    v-model="dataFormMenu[item.code]"
                    placeholder="描述"
                ></el-input>
                <!-- inputNumber -->
                <el-input-number
                    v-if="item.type === 'inputNumber'"
                    v-model="dataFormMenu[item.code]"
                    controls-position="right"
                    :min="0"
                    :label="item.label"
                />
                <slot v-if="item.slot" :name="item.slot">slot</slot>
            </el-form-item>
        </div>
    </div>
</template>
<script>
export default {
    props: {
        dataFormConfig: {
            type: Array,
            default: () => []
        },
        dataFormMenu: {
            type: Object,
            default: () => {}
        }
    },
    data() {
        return {}
    }
}
</script>
